package org.apache.http.entity.mime.content;

import java.nio.charset.Charset;
import org.apache.http.entity.b;

public abstract class a implements ContentBody {
    private final b a;

    public a(b bVar) {
        org.apache.http.a.a.a((Object) bVar, "Content type");
        this.a = bVar;
    }

    public b a() {
        return this.a;
    }

    public String getCharset() {
        Charset b = this.a.b();
        return b != null ? b.name() : null;
    }

    public String getMediaType() {
        String a = this.a.a();
        int indexOf = a.indexOf(47);
        return indexOf != -1 ? a.substring(0, indexOf) : a;
    }

    public String getMimeType() {
        return this.a.a();
    }

    public String getSubType() {
        String a = this.a.a();
        int indexOf = a.indexOf(47);
        return indexOf != -1 ? a.substring(indexOf + 1) : null;
    }
}
